package com.geeguo.ebuilder.client.business.system.role.service;

import com.geeguo.ebuilder.client.base.tenant.model.DataContext;
import com.geeguo.ebuilder.client.business.system.role.model.RoleEntity;
import com.geeguo.ebuilder.client.business.system.role.model.RoleQuery;
import com.geeguo.ebuilder.client.business.system.role.model.RoleVO;
import com.geeguo.ebuilder.core.common.model.vo.PageListVO;

import java.util.List;
import java.util.Set;

public interface RoleService {

    PageListVO<RoleVO> list(RoleQuery query, DataContext dataContext);
    List<RoleVO> listAll(DataContext dataContext);
    Set<String> listIdByUser(String userId, DataContext dataContext);
    Set<String> listCodeByUser(String userId, DataContext dataContext);

    RoleVO get(String id, DataContext dataContext);
    RoleVO getByCode(String code, DataContext dataContext);
    RoleVO getByName(String name, DataContext dataContext);

    boolean save(RoleEntity entity, DataContext dataContext);
    boolean update(RoleEntity current, RoleEntity old, DataContext dataContext);
    boolean remove(String id, DataContext dataContext);
    boolean isUsed(String id, DataContext dataContext);
}